﻿@model LanDBom.Models.parice
@using LanDBom.Resources
@using LanDBom.Models
@{
    ViewBag.Title = "Create";
}

<h2>添加原料信息</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    <fieldset class="boun">
        <table class="form-horizontal table-app" cellpadding="5" style="width:90%;">
            <tr class="form-group">
                <td>@Html.Label(Resource.String771, htmlAttributes: new { @class = "control-label " })</td>
                <td class="">
                    @Html.EditorFor(model => model.PA_Pinpai, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.PA_Pinpai, "", new { @class = "text-danger" })
                </td>
                <td> @Html.Label(Resource.String772, htmlAttributes: new { @class = "control-label " })</td>
                <td class="">
                    @Html.EditorFor(model => model.PA_ZhongL, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.PA_ZhongL, "", new { @class = "text-danger" })
                </td>
            </tr>
            <tr class="form-group">
                <td>@Html.Label(Resource.String773, htmlAttributes: new { @class = "control-label " })</td>
                <td class="">
                    @Html.EditorFor(model => model.PA_KZ, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.PA_KZ, "", new { @class = "text-danger" })
                </td>
                <td> @Html.Label(Resource.String774, htmlAttributes: new { @class = "control-label " })</td>
                <td class="">
                    @Html.EditorFor(model => model.PA_T, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.PA_T, "", new { @class = "text-danger" })
                </td>
            </tr>
            <tr class="form-group">
                <td>@Html.Label(Resource.String775, htmlAttributes: new { @class = "control-label " })</td>
                <td class="">
                    @Html.EditorFor(model => model.PA_Time, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.PA_Time, "", new { @class = "text-danger" })
                </td>
                <td> @Html.Label(Resource.String776, htmlAttributes: new { @class = "control-label " })</td>
                <td class="">
                    <input type="text" name="PA_LengBie" value="" class="form-control" id="PA_LengBie" list="seleect_codeDE" />
                    <datalist id="seleect_codeDE" class="form-control" style="display:none">
                        @{ 
                            var shun = "";
                        }
                        @foreach (var item in ViewBag.HUNF as List<parice>)
                        {
                            if (item.PA_LengBie != shun)
                            {
                                <option value="@item.PA_LengBie">@item.PA_LengBie</option>
                            }
                            shun = item.PA_LengBie;
                        }
                    </datalist>
                </td>
            </tr>
            <tr class="form-group">
                <td>@Html.Label(Resource.String777, htmlAttributes: new { @class = "control-label " })</td>
                <td class="">
                    @Html.DropDownList("PA_Shuxing", null, htmlAttributes: new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.mateial.MA_fne, "", new { @class = "text-danger" })
                </td>
            </tr>
            <tr class="form-group">
                <td class="col-md-offset-2 ">
                    <input type="submit" value="添加" class="btn-sm btn-default" />
                </td>
                <td><button class="btn-sm btn-default">@Html.ActionLink(Resource.String778, "Index", "parices", new { @style = "color:#000" })</button> </td>
            </tr>
        </table>
    </fieldset>
    
}
@section scripts{
    <script src="~/Scripts/jquery-3.4.1.min.js"></script>
    <script src="~/Scripts/bootstrap.min.js"></script>
    <script>
        $(function () {
            $("#li21").css({ "color": "black", "background-color": "white" })
            var now = new Date($.now());
            //获取当前年月日
            var year = (now.getFullYear()).toString();
            var month = (now.getMonth() + 1).toString();
            var date = (now.getDate()).toString();
            var qishi_time2 = year + "/" + month + "/" + date
            $("#PA_Time").val(qishi_time2)
            $("#PA_Time").prop('disabled', true)
        })
    </script>
}